package com.papercutting.platform.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户学习记录响应信息
 */
@Data
public class UserStudyResponse implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 学习记录ID
     */
    private Long id;
    
    /**
     * 用户ID
     */
    private Long userId;
    
    /**
     * 教程ID
     */
    private Long tutorialId;
    
    /**
     * 学习进度(百分比)
     */
    private Integer progress;
    
    /**
     * 当前学习步骤
     */
    private Integer currentStep;
    
    /**
     * 总步骤数
     */
    private Integer totalSteps;
    
    /**
     * 学习时长(秒)
     */
    private Integer studyDuration;
    
    /**
     * 是否完成
     */
    private Boolean isCompleted;
    
    /**
     * 完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime completedTime;
    
    /**
     * 最后学习时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastStudyTime;
    
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    
    /**
     * 关联的教程信息
     */
    private TutorialInfo tutorial;
    
    /**
     * 教程信息简化类
     */
    @Data
    public static class TutorialInfo implements Serializable {
        private Long id;
        private String title;
        private String subtitle;
        private String coverImage;
        private String summary;
        private Integer difficultyLevel;
        private Integer category;
        private Integer estimatedTime;
        private Integer stepsCount;
        private Integer viewCount;
        private Integer likeCount;
        private Integer favoriteCount;
    }
}


